# def fun1(a,b):
#     print(a+b)
#
#
# fun1(10,2)
# print(fun1(1,2))


def fun1(a, b):
    s = a + b
    return s


c = fun1(10, 20)
print(c)
d = fun1(fun1(10, 20), 30)
print(d)


def calc_sum(num):
    sum = 0
    odd_sum = 0
    even_sum = 0
    for i in range(1, num + 1):
        if i % 2 != 0:
            odd_sum += i
        else:
            even_sum += i
        sum += i
    return odd_sum, even_sum, sum


result = calc_sum(10)
print(type(result))  # 返回值类型为tuple
print(result)   # (25, 30, 55)

# 解包
odd_sum, even_sum, sum = calc_sum(10)
print(odd_sum)
print(even_sum)
print(sum)